﻿using Reference.WebRole.DataContracts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;

namespace Reference.WebRole.ServiceContracts
{
    [ServiceContract]
    public interface IReferenceService
    {
        [OperationContract]
        [WebInvoke(UriTemplate = "/Groups", Method = "GET")]
        List<CodeGroup> GetGroups();

        [OperationContract]
        [WebInvoke(UriTemplate = "/Snippets/Recent/{groupId}", Method = "GET")]
        List<CodeSnippetLight> GetRecentSnippets(string groupId);

        [OperationContract]
        [WebInvoke(UriTemplate = "/Snippet/{groupId}/{snippetId}", Method = "GET")]
        CodeSnippet GetSnippet(string groupId, string snippetId);

        [OperationContract]
        [WebInvoke(UriTemplate = "/Snippets/count/{count}/{groupId}/{lastSnippetId}", Method = "GET")]
        List<CodeSnippetLight> GetNextSnippets(string groupId, string lastSnippetId, string count);

        [OperationContract]
        [WebInvoke(UriTemplate = "/Snippets/{term}/{word}", Method = "GET")]
        List<CodeSnippetLight> GetSearchSnippets(string term, string word);

    }
}
